home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Software für Mac-OS X / Entwickler-Tools / netbeans / modules / ext / djava.jar / koala / dynamicjava / tree / WhileStatement.class (.txt) < prev   
Encoding:
Java Class File  |  2000-03-14  |  2.1 KB  |  71 lines

  1. package koala.dynamicjava.tree;
  2.  
  3. import java.util.LinkedList;
  4. import java.util.List;
  5. import koala.dynamicjava.tree.visitor.Visitor;
  6.  
  7. public class WhileStatement extends Statement implements ContinueTarget {
  8.    public static final String CONDITION = "condition";
  9.    public static final String BODY = "body";
  10.    private Expression condition;
  11.    private Node body;
  12.    private List labels;
  13.  
  14.    public Expression getCondition() {
  15.       return this.condition;
  16.    }
  17.  
  18.    public void setCondition(Expression var1) {
  19.       if (var1 == null) {
  20.          throw new IllegalArgumentException("e == null");
  21.       } else {
  22.          ((Node)this).firePropertyChange("condition", this.condition, this.condition = var1);
  23.       }
  24.    }
  25.  
  26.    public Node getBody() {
  27.       return this.body;
  28.    }
  29.  
  30.    public void setBody(Node var1) {
  31.       if (var1 == null) {
  32.          throw new IllegalArgumentException("node == null");
  33.       } else {
  34.          ((Node)this).firePropertyChange("body", this.body, this.body = var1);
  35.       }
  36.    }
  37.  
  38.    public void addLabel(String var1) {
  39.       if (var1 == null) {
  40.          throw new IllegalArgumentException("label == null");
  41.       } else {
  42.          this.labels.add(var1);
  43.       }
  44.    }
  45.  
  46.    public boolean hasLabel(String var1) {
  47.       return this.labels.contains(var1);
  48.    }
  49.  
  50.    public Object acceptVisitor(Visitor var1) {
  51.       return var1.visit(this);
  52.    }
  53.  
  54.    public WhileStatement(Expression var1, Node var2) {
  55.       this(var1, var2, (String)null, 0, 0, 0, 0);
  56.    }
  57.  
  58.    public WhileStatement(Expression var1, Node var2, String var3, int var4, int var5, int var6, int var7) {
  59.       super(var3, var4, var5, var6, var7);
  60.       if (var1 == null) {
  61.          throw new IllegalArgumentException("cond == null");
  62.       } else if (var2 == null) {
  63.          throw new IllegalArgumentException("body == null");
  64.       } else {
  65.          this.condition = var1;
  66.          this.body = var2;
  67.          this.labels = new LinkedList();
  68.       }
  69.    }
  70. }
  71.